
import { request } from '@/utils/request';


import { BaseModel } from '@/api/common/baseModel';

export interface Model extends BaseModel {
  merchantId: string
  appId: string
  channelId: string
  channelCode: string
  merchantOrderId: string
  subject: string
  body: string
  notifyUrl: string
  notifyStatus: number
  amount: number
  channelFeeRate: number
  channelFeeAmount: number
  userIp: string
  expireTime: Date
  successTime: Date
  notifyTime: Date
  successExtensionId: string
  refundStatus: number
  refundTimes: number
  refundAmount: number
  channelUserId: string
  channelOrderNo: string
  createTime: Date
}

export interface OrderPageReqVO {
  merchantId?: number
  appId?: number
  channelId?: number
  channelCode?: string
  merchantOrderId?: string
  subject?: string
  body?: string
  notifyUrl?: string
  notifyStatus?: number
  amount?: number
  channelFeeRate?: number
  channelFeeAmount?: number
  status?: number
  expireTime?: Date[]
  successTime?: Date[]
  notifyTime?: Date[]
  successExtensionId?: number
  refundStatus?: number
  refundTimes?: number
  channelUserId?: string
  channelOrderNo?: string
  createTime?: Date[]
}

export interface OrderExportReqVO {
  merchantId?: number
  appId?: number
  channelId?: number
  channelCode?: string
  merchantOrderId?: string
  subject?: string
  body?: string
  notifyUrl?: string
  notifyStatus?: number
  amount?: number
  channelFeeRate?: number
  channelFeeAmount?: number
  status?: number
  expireTime?: Date[]
  successTime?: Date[]
  notifyTime?: Date[]
  successExtensionId?: number
  refundStatus?: number
  refundTimes?: number
  channelUserId?: string
  channelOrderNo?: string
  createTime?: Date[]
}

// 查询列表支付订单
export const getPage = async (params: any,) => {
  return await request.get({
    url: '/staff/web/userCenter/trade/tradeOrder/page.json',
    params
  })
}

// 查询详情支付订单
export const getOrder = async (id: string) => {
  return await request.get({
    url: '/staff/web/userCenter/trade/tradeOrder/getById.json?id=' + id
  })
}

// 获得支付订单的明细
export const getById = async (id: string) => {
  return await request.get({
    url: '/staff/web/userCenter/trade/tradeOrder/getById.json?id=' + id
  })
}

// 修改支付订单
export const update = async (data: any) => {
  return await request.put({
    url: '/staff/web/userCenter/trade/tradeOrder/update.json',
    data
  })
}

// 删除支付订单
export const del = async (id: string) => {
  return await request.delete({
    url: '/staff/web/userCenter/trade/tradeOrder/del.json?id=' + id, data: [id,],
  })
}

// 支付订单
export const chart = async () => {
  return await request.get({
    url: '/staff/web/userCenter/trade/tradeOrder/chart.json'
  })
}
